import { toRefs } from 'vue'
import { useStore } from 'vuex'

export const useCommonCartEffect = (shopId) => {
	const store = useStore()
	const { cartList } = toRefs(store.state)
	const changeToCart = (shopId, productId, product, num) => {
		store.commit('changeToCart', { shopId, productId, product, num })
	}
	return {
		cartList,
		changeToCart
	}
}
